package com.dingding.common.core.config;

import org.apache.log4j.Logger;

/**
 * 
 * @ClassName: JPushConfig 
 * @Description:极光推送配置类
 * @author CHEHAUNBO 
 * @date 2016年5月26日 下午4:02:41
 * 
 */
public class JPushConfig extends AbstractConfig {

	private static final Logger log = Logger.getLogger(JPushConfig.class);

	private static boolean ENV_JPUSH = true; // 推送环境默认为生产环境

	private static ClientTypeEnum CLIENT_TYPE = ClientTypeEnum.PASSENGER; // 登录设备端

	private static String DRIVER_APP_KEY = Constants.JPUSH_DRIVER_APP_KEY; // 专车车主端推送专用key
	private static String DRIVER_MASTER_SECRET = Constants.JPUSH_DRIVER_APP_SECRET; // 专车车主端推送专用SECRET

	private static String IOS_APP_KEY = Constants.JPUSH_IOS_APP_KEY;
	private static String ANDROID_APP_KEY = Constants.JPUSH_ANDROID_APP_KEY;

	private static String IOS_MASTER_SECRET = Constants.JPUSH_IOS_MASTER_SECRET;
	private static String ANDROID_MASTER_SECRET = Constants.JPUSH_ANDROID_MASTER_SECRET;

	/**
	 * 初始化极光推送配置
	 * @Title: intitalConfigValue 
	 * @author CHEHAUNBO
	 * 
	 */
	@Override
	public void intitalConfigValue() {

		boolean flag = prop.getBoolean("env_jpush");

		if (!flag) { // 测试环境
			ENV_JPUSH = flag;
		}

		log.info("正在初始化极光推送相关配置！初始化后的值：" + toString());

	}

	public static String getIosAppKey() {
		return IOS_APP_KEY;
	}

	public static String getAndroidAppKey() {
		return ANDROID_APP_KEY;
	}

	public static String getIosMasterSecret() {
		return IOS_MASTER_SECRET;
	}

	public static String getAndroidMasterSecret() {
		return ANDROID_MASTER_SECRET;
	}

	public static boolean isENV_JPUSH() {
		return ENV_JPUSH;
	}

	public static void setENV_JPUSH(boolean eNV_JPUSH) {
		ENV_JPUSH = eNV_JPUSH;
	}

	public static String getIOS_APP_KEY() {
		return IOS_APP_KEY;
	}

	public static String getANDROID_APP_KEY() {
		return ANDROID_APP_KEY;
	}

	public static String getIOS_MASTER_SECRET() {
		return IOS_MASTER_SECRET;
	}

	public static String getANDROID_MASTER_SECRET() {
		return ANDROID_MASTER_SECRET;
	}

	public static ClientTypeEnum getCLIENT_TYPE() {
		return CLIENT_TYPE;
	}

	public static void setCLIENT_TYPE(ClientTypeEnum cLIENT_TYPE) {
		CLIENT_TYPE = cLIENT_TYPE;
	}

	public static String getDRIVER_APP_KEY() {
		return DRIVER_APP_KEY;
	}

	public static void setDRIVER_APP_KEY(String dRIVER_APP_KEY) {
		DRIVER_APP_KEY = dRIVER_APP_KEY;
	}

	public static String getDRIVER_MASTER_SECRET() {
		return DRIVER_MASTER_SECRET;
	}

	public static void setDRIVER_MASTER_SECRET(String dRIVER_MASTER_SECRET) {
		DRIVER_MASTER_SECRET = dRIVER_MASTER_SECRET;
	}

	public static void setIOS_APP_KEY(String iOS_APP_KEY) {
		IOS_APP_KEY = iOS_APP_KEY;
	}

	public static void setANDROID_APP_KEY(String aNDROID_APP_KEY) {
		ANDROID_APP_KEY = aNDROID_APP_KEY;
	}

	public static void setIOS_MASTER_SECRET(String iOS_MASTER_SECRET) {
		IOS_MASTER_SECRET = iOS_MASTER_SECRET;
	}

	public static void setANDROID_MASTER_SECRET(String aNDROID_MASTER_SECRET) {
		ANDROID_MASTER_SECRET = aNDROID_MASTER_SECRET;
	}

	@Override
	public String toString() {
		return "推送环境：" + ENV_JPUSH + "[IOS_APP_KEY]:" + IOS_APP_KEY + "[ANDROID_APP_KEY]:" + ANDROID_APP_KEY
				+ "[IOS_MASTER_SECRET]:" + IOS_MASTER_SECRET + "[ANDROID_MASTER_SECRET]:" + ANDROID_MASTER_SECRET;
	}

}
